﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="ChangePassWord.aspx.cs" Inherits="ChangePassWord" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
 <link href="js/validationEngine.jquery.css" rel="stylesheet" type="text/css" />
    <script src="js/jquery.validationEngine.js" type="text/javascript"></script>
    <script src="js/jquery.validationEngine-en.js" type="text/javascript"></script>
<script>
        $(document).ready(function () {
            jQuery(".form").validationEngine({ scroll: false, focusFirstField: false });
            $("#dgChangeSuccess").dialog({
                resizable: false,
                width: 270,
                modal: true,
                autoOpen: false,
                buttons: [{
                    text: "Ok",
                    click: function () {
                        $(this).dialog("close");
                        window.location = "index.aspx";
                    }
                }]
            });

        });
    function changepass() {
        if ($("#<%=new_password.ClientID%>").val() == '') {
            alert('Please input password');
            $("#new_password").focus();
            return false;
        }
        else if ($("#<%=confirm_password.ClientID%>").val() == '') {
            alert('Please input password to confirm');
            $("#confirm_password").focus();
            return false;
        }
        if ($("#<%=new_password.ClientID%>").val() != $("#<%=confirm_password.ClientID%>").val()) {
            alert('Password is not mark!');
            $("#manager_confirm_new_password").val("");
            $("#manager_confirm_new_password").focus();
            return false;
        }
    }

    function customValidate(field, rules, i, options) {
        var pattern = new RegExp(/^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/);
        var match = pattern.exec(field.val());
        if (field.val() == "") {
            return true;
        }
        else if (match == null) {
            return options.allrules.email.alertText;
        }
    }
</script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
<section id="bg_content">
<div id="content" class="clearfix">
        <div class="alpha01 clearfix">
            <div class="bg01">
                <div class="bg02">
                    <%--<div class="bg03 clearfix">--%>
                    <div class="bg03 clearfix" style="padding:10px;">
                        <form method="post" action="#">
                        <div >
                        <div class="accountdiv">
                            <p class="title01">Change Password</p>
                        </div>
                        <div style="clear:both"></div>
                        <div class="accountdiv">
                            <div class="text-field">
                            New Password:
                            </div>
                            <div class="ip-text">
                                <asp:TextBox CssClass="validate[required,minSize[5],maxSize[50]] input-trpr" ID="new_password" runat="server" type="password"></asp:TextBox>
                            </div>
                        </div>
                        <div style="clear:both"></div>
                        <div class="accountdiv">
                            <div class="text-field">
                            Confirm New Password:
                            </div>
                            <div class="ip-text">
                            <asp:TextBox  CssClass="validate[required,equals[MainContent_new_password]] input-trpr"  ID="confirm_password" runat="server" type="password"
                               ></asp:TextBox>
                            </div>
                        </div>
                        <div style="clear:both"></div>
                        <div class="accountdiv" style="text-align:center; margin-top:10px;">
                            <asp:Button ID="btnChangePass" runat="server" CssClass="button-form"  Text="Submit"
                                onclick="btnChangePass_Click" OnClientClick="return jQuery('.form').validationEngine('validate')" />
                        </div>
                        </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
<div id="dgChangeSuccess" class="message-diaglog">
                  <p>Change password successfully</p>
                </div>
</asp:Content>

